add document by api php

32

<?php
//function to add lead by API
function ADDLeadCamp($companyID,$name,$prenom,$email,$societe,$phone){

	$data = array('campaign_id'=>$companyID,'nom'=>$name,'prenom'=>$prenom,'email' =>$email,
	'phone'=>$phone,
	'societe'=>$societe,
  );
   $URL     = 'https://www.yestravaux.com/webservice/crm/lead.php';
   $data=json_encode($data);
   $POSTVALUE  = 'fct=AddLeadApi&data='.$data.'&cmpid='.$companyID; 
   $dataAddLead=curl_do_post($URL,$POSTVALUE);
  if($dataAddLead==1){
	  echo 'ok';
}
else{
	echo 'error';
}}
?>

Comments

Submit
0 Comments